package com.cheer.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cheer.entity.ExMatchHistoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * 比赛表
 * 
 * @author cheer
 */
@Mapper
@Repository
public interface ExMatchHistoryDao extends BaseMapper<ExMatchHistoryEntity> {

    @Select("select count(distinct(u.id)) from ex_match_user u inner join ex_match_history h on u.id = h.user_id where u.organization = #{orgId} and u.office = #{officeId};")
    Integer selectCountByOrg(@Param("orgId") Integer orgId, @Param("officeId") Integer officeId);
}
